/*
 * CanBotLL.h
 *
 *  Created on: 6-mrt.-2014
 *      Author: thomas
 */

#ifndef CANBOTLL_H_
#define CANBOTLL_H_

#include "Serial.h"
#include <stdlib.h>
#include <unistd.h>
#include <cmath>

#define LOW_SPEED 50
#define MAX_SPEED 200

const int CLAW_OPEN = 1;
const int CLAW_CLOSE = 0;
//Drempelwaarden voor snelheid:
#define ANGLE_HIGH_SPEED 10
#define DIST_HIGH_SPEED 20 //cm

//Duurtijd voor motoren:
//#define US_10DG_HS 1000
#define US_1DG_HS 9625
//NOG BEREKENEN
//#define US_1DG_LS 1000
#define US_1UNIT_HS 10000

class CanBotLL {
private:
	Serial *ser_robot;
	void driveMotor(int speedL, int speedR);
	string serial_read;

public:
	CanBotLL();
	virtual ~CanBotLL();

	//Claw open/close
	int claw(int);

	//eerste instantie
	int turn(int angle);
	int drive(int distance);
	int catchCan();
	int distance();
	//tweede instantie
	int turnStart(int dir); //0 rechts 1 links
	int driveStart(int dir);//0 achter 1 voor
	int movementStop();
};

#endif /* CANBOTLL_H_ */
